<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="description" content="<?php echo $this->config->item('title');?>">
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
    <title><?php echo $this->config->item('title');?></title>
    <link rel="stylesheet" href="<?php echo base_url()?>css/style_all.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="<?php echo base_url()?>css/style3.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="<?php echo base_url()?>css/jquery-ui.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="<?php echo base_url()?>css/jquery.wysiwyg.css" type="text/css" media="screen"/>
    <!--Internet Explorer Trancparency fix-->
    <!--[if IE 6]>
    <script src="<?php echo base_url()?>js/ie6pngfix.js"></script>
    <script>
    DD_belatedPNG.fix('#head, a, a span, img, .message p, .click_to_close, .ie6fix');
   	</script>
    <![endif]--> 
        
	<script type="text/javascript" src="<?php echo base_url()?>js/jquery.js"></script>
    <script type="text/javascript" src="<?php echo base_url()?>js/jquery-ui.js"></script>
    <script type="text/javascript" src="<?php echo base_url()?>js/jquery.wysiwyg.js"></script>
    <script type="text/javascript" src="<?php echo base_url()?>js/custom.js"></script>
    
    
    
    <script type='text/javascript' src='<?php echo base_url()?>js/jquery.form.js'></script>
    <script type="text/javascript" src="<?php echo base_url()?>js/jquery.colorbox-min.js"></script>
    <link rel="stylesheet" href="<?php echo base_url()?>css/colorbox/colorbox.css" type="text/css" media="screen"/>
   
    <script type="text/javascript">
        	jQuery(function($) {
        		$('.common_form').ajaxForm({
            		dataType:  'json',
            		beforeSubmit:  showRequest,
            		success:   processJson
        		});

    			function showRequest(formData, jqForm, options) {
    				$("#input_info").removeClass("success");
    				$("#input_info").addClass("error");
    				if ($("#org_password").val().replace(/[^\d]/g,'')=="") {
    					$("#input_info").show(200);
                		$("#input_info").find("p").html("请输入您的原始密码.");
                		return false;
					}
    				if ($("#password").val().replace(/[^\d]/g,'')!=$("#password1").val().replace(/[^\d]/g,'')) {
    					$("#input_info").show(200);
                		$("#input_info").find("p").html("两次输入的密码不一致,请重新输入.");
                		return false;
					}
					if($("#password").val().replace(/[^\d]/g,'').length>20||$("#password").val().length<5){
						$("#input_info").show(200);
                		$("#input_info").find("p").html("密码的长度必须为5~20位.");
                		return false;
					}
    				$("#input_info").hide(200);
        		  	$(".clearboth").text("正在提交...");
        		}

        		function processJson(data) {
            		if (data.result==false) {
            			$("#input_info").removeClass("success");
        				$("#input_info").addClass("error");
                		}else{
						$("#input_info").removeClass("error");
	    				$("#input_info").addClass("success");
					}
            		$("#input_info").show(200);
            		$("#input_info").find("p").html(data.message);
					$(".clearboth").html("<input class=\"button\" name=\"submit\" type=\"button\" value=\"修改密码\">");
        		}



				$(".button").live('click',function(){
					$.ajax({
        				type: "post",
        				url: "<?php echo base_url()?>index.php/common_login_manage/check_login",
        				dataType:"json",
        				beforeSend: function(XMLHttpRequest){
            				
        				},
        				success: function(data, textStatus){
        					
        			        if(data.result==false){
        			        	$.colorbox({open:true,href:"<?php echo base_url()?>index.php/common_login_manage/login_form",title:"您的登录已超时"});
                			}else{
                				$('.common_form').submit();
	                		}
        			       
        				},
        				complete: function(XMLHttpRequest, textStatus){
        					
        				},
        				error: function(){
        					
            			}
    				});
					
				});



        	});
        </script>
    </head>
	<body >    	
        <div id="top">
            <div id="head">
            	<h1 class="logo">
                	<a href="<?php echo base_url()?>"><?php echo $this->config->item('title');?></a>
                </h1>
                
                <div class="head_memberinfo">
<!--                	<div class="head_memberinfo_logo">-->
<!--                    	<span>1</span>-->
<!--                    	<img src="./images/unreadmail.png" alt="">-->
<!--                    </div>-->
                    
                    <span class="memberinfo_span">
                   		 你好, <a href=""><?php echo $this->session->userdata("user_name")?></a>
                    </span>
                    
                    <span class="memberinfo_span">
                    	<a href="<?php echo base_url()."index.php/common_login_user_set"?>">设置</a>
                    </span>
                    
                    <span>
                    	<a href="<?php echo base_url()?>index.php/common_login_manage/logout">登出</a>
                    </span>
                    
<!--                    <span class="memberinfo_span2">-->
<!--                    	<a href="">1 Private Message recieved</a>-->
<!--                    </span>-->
                </div><!--end head_memberinfo-->
            
            </div><!--end head-->
           	
            <div id="bg_wrapper">
                
            	<div id="main">
                    
                	<div id="content">
                		<div class="jquery_tab_container"></div>
                        
                        <div class="jquery_tab tablist ">
                            
                        	<div class="content_block">
                            	<h2>修改密码</h2>
                            	<div class="message error" id="input_info" style="display:none;">
                                	<p></p>
                                </div>
                                <form method="post" action="<?php echo base_url()?>index.php/common_login_user_set/change_password" class="common_form">
                                	<p>
                                    	<label for="org_password">原始密码(必填)</label>
                                        <input class="input-medium" type="password" value="" name="org_password" id="org_password" required>
                                  	</p>
                                   	<p>
                                       	<label for="password">新密码(必填)</label>
                                        <input class="input-medium" type="password" value="" name="password" id="password" required>
                                    </p>
                                    <p>
                                        <label for="password1">再试一次(必填)</label>
                                        <input class="input-medium" type="password" value="" name="password1" id="password1" required>
                                    </p>
                                    
                                    <p>
                                        <span class="clearboth">
                                            <input class="button" name="submit" type="button" value="修改密码">
                                        </span>
                                    </p>
                               	</form>
                                    
                                </div><!--end content_block-->
							</div><!-- end jquery_tab -->
                        </div><!--end content-->
                    </div><!--end main-->
                    
              		<div id="sidebar">
                    	<?php echo $user_menu;?><!--end subnav-->
                            
                        </div><!--end sidebar-->
                        
                     </div><!--end bg_wrapper-->
                     
                <div id="footer">
                <?php echo $this->config->item("footer")?>
                </div><!--end footer-->
        </div><!-- end top -->
	</body>
</html>